﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="ShowList_Empoyee.aspx.cs" Inherits="EmployeeCheckIn.ShowList_Empoyee" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1
        {
            width: 93%;
            height: 91px;
        }
        .style9
        {
            height: 28px;
            padding: 20px;
        }
        .style11
        {
            height: 10px;
        }
        .style12
        {
            width: 27px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table class="style1" align="center">
        <tr>
            <td align="left" class="style9">
                <asp:Label ID="Label1" runat="server" Font-Size="Large" Text="ข้อมูลพนักงาน" ForeColor="Black"></asp:Label>
            </td>
        </tr>
        <tr>
            <td align="center" class="style11">
                <table style="width: 100%;">
                    <tr>
                        <td class="style12">
                            &nbsp;
                        </td>
                        <td>
                            <asp:Label ID="Label2" runat="server" Text="จากวันที่เริ่มงาน :"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="TextBox_date_sert2" runat="server" class="dateInput" Height="24px"
                                Width="140px" onfocus="javascript: if(this.value != 'A new value'){ this.value = ''; }"
                                onblur="javascript: if(this.value==''){this.value='';}"></asp:TextBox>
                        </td>
                        <td>
                            <asp:Label ID="Label3" runat="server" Text="ถึง"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="TextBox_date_sert1" runat="server" class="dateInput" Height="24px"
                                Width="140px" onfocus="javascript: if(this.value != 'A new value'){ this.value = ''; }"
                                onblur="javascript: if(this.value==''){this.value='';}"></asp:TextBox>
                        </td>
                        <td>
                            <asp:Label ID="Label_sert" runat="server" Text="รหัสพนักงาน/ชื่อ"></asp:Label>
                        </td>
                        <td>
                            <asp:TextBox ID="TextBox_insert" runat="server" Height="24px" Width="140px" onfocus="javascript: if(this.value != 'A new value'){ this.value = ''; }"
                                onblur="javascript: if(this.value==''){this.value='';}"></asp:TextBox>
                        </td>
                        <td>
                            <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="ค้นหา" Width="50px" />
                        </td>
                    </tr>
                    <tr>
                        <td class="style12">
                            &nbsp;
                        </td>
                        <td>
                            <asp:Button ID="Add_emp" runat="server" OnClick="Add_emp_Click" Text="เพิ่มพนักงาน" />
                        </td>
                        <td align="center" colspan="5">
                <asp:Label ID="Label_Nodata" runat="server" Font-Size="Small" ForeColor="Red" Text="----------ไม่พบข้อมูลการค้นหา----------"
                    Visible="False" EnableTheming="True"></asp:Label>
                            &nbsp;
                        </td>
                        <td>
                            <asp:Button ID="Bt_export" runat="server" OnClick="Bt_export_Click" Text="Export Excel" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td align="center">
                <br />
                <asp:GridView ID="GridView1" CssClass="gv" runat="server" Width = "100%" 
                    AutoGenerateColumns="False" BackColor="White"
                    BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3" HorizontalAlign="Center"
                    OnRowCommand="GridView1_RowCommand" OnRowCreated="GridView1_RowCreated" 
                    EnableModelValidation="True">
                    <Columns>
                        <asp:TemplateField HeaderText="No">
                            <ItemStyle HorizontalAlign="Center" />
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemTemplate>
                                <%#Container.DataItemIndex+1%>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="EMP_CODE" HeaderText="รหัสพนักงาน"></asp:BoundField>
                        <asp:BoundField DataField="EMP_FIRSTNAME" HeaderText="ชื่อ" />
                        <asp:BoundField DataField="EMP_LASTNAME" HeaderText="นามสกุล" />
                        <asp:BoundField DataField="POSITION_NAME" HeaderText="ตำแหน่ง" />
                        <asp:BoundField DataField="EMP_START_DATE" DataFormatString="{0:dd/MM/yyyy}" HtmlEncode="false"
                            HeaderText="วันที่เริ่มงาน" >
                        <ItemStyle HorizontalAlign="Center" />
                        </asp:BoundField>
                        <asp:BoundField DataField="EMP_STATUS_NAME" HeaderText="สถานะ" />
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:ImageButton ID="Imbt_showdata" CommandName="cmdShowdata" CommandArgument='<%# Eval("EMP_CODE") %>' ToolTip="ดูข้อมูล"
                                    runat="server" Height="25px" ImageUrl="~/Immages/icon/folder_blue_explorer.png"
                                    Width="25px" />
                                <asp:ImageButton ID="Imbt_edit" CommandName="cmdEdit" CommandArgument='<%# Eval("EMP_CODE") %>' ToolTip="แก้ไขข้อมูล"
                                    runat="server" Height="25px" ImageUrl="~/Immages/icon/edit.png" Width="25px" />
                                <asp:ImageButton ID="Imbt_delete" CommandName="cmdDelete" CommandArgument='<%# Eval("EMP_CODE") %>' ToolTip="ลบข้อมูล"
                                    runat="server" Height="25px" ImageUrl="~/Immages/icon/button_cancel.png" Width="25px"
                                    OnClientClick="if(!confirm('ยืนยันการลบข้อมูล')) return false;" />
                                <asp:ImageButton ID="Imbt_showtime" CommandName="cmdShowtime" CommandArgument='<%# Eval("EMP_CODE") %>' ToolTip="จัดการเวลา"
                                    runat="server" Height="25px" ImageUrl="~/Immages/icon/clock.png" Width="25px" />
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                    </Columns>
                    <FooterStyle BackColor="White" ForeColor="#000066" />
                    <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
                    <PagerStyle ForeColor="#000066" HorizontalAlign="Left" BackColor="White" />
                    <RowStyle ForeColor="#000066" />
                    <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                </asp:GridView>
                <br />
                <br />
                <br />
            </td>
        </tr>
    </table>
</asp:Content>
